Skip to main content

Unit 4 Exercise 10

Exercise 10: File Movement

Objective

To utilize the Windows Sub-Types to Copy, Rename, Move and Delete a file.

Summary

You will create two directories and one file in a File Explorer window and then manipulate the movement of that file utilizing the Copy, Rename, Move and Delete sub-types.

Then you will manually release each of the jobs and monitor the movement of the file.

Instructions

Create Directories and the File

  1. In a Windows Explorer create two directories, C:\Finish and C:\Start.
  2. Open Notepad and create a new file.
  3. Type something in the file and save it as File-to-be-copied.txt in the C:\Start directory.
  4. Close Notepad.

Create the Schedule

  1. In Library > Administration, select Master Schedules.
  2. Click the Add button.
  3. On the Master Schedule Definition screen:
  • In the Name field, enter Windows Sub-Types Exercise.
  • In the Documentation field, enter in some documentation.
    • Example: This is a training Schedule for Windows Sub-Type Jobs.
  • Saturday and Sunday are non-working days.
  • Do NOT configure Auto Build.
  • Click the Save.
  1. Click Back.

Add the Copy Job to the Schedule

  1. Utilizing the filters in the Schedule List, locate and select Windows Sub-Types Exercise.
  2. Select Add Job in the side menu.
  3. On Master Job Definition screen:
  • In the Name field, enter File Copy.
  • In the Job Type dropdown, select Windows.
  • In the Machine Selection dropdown, select the SMATraining machine for the Job to run on.
  • In the Job Sub-Type section, click the blue Edit button.
  • In the Job Sub-Type Details pop-up window:
    • Select Command: File Copy.
    • In the Source field, type C:\Start\File-to-be-copied.txt
    • In the Destination field, type C:\Start\File-to-be-renamed.txt
    • Click the Save button.
  • In the User ID dropdown, select SMATRAINING\SMAUSER
  • Click the Save.
  • Click the Lock button in the upper right-hand corner.
  • Add some Documentation to the Job.
  • In the Frequency section, move Mon-Sun-O from the Inactive column and to the Active column.
  • Select the Frequency in the Active column and in Job Build Status dropdown, select On Hold.
  • Click the Save button.
  1. Click Back.

Add the Rename Job to the Schedule

  1. Select Add Job in the side menu.
  2. On Master Job Definition screen:
  • In the Name field, enter File Rename.
  • In the Job Type dropdown, select Windows.
  • In the Machine Selection dropdown, select the SMATraining machine for the Job to run on.
  • In the Job Sub-Type section, click the blue Edit button.
  • In the Job Sub-Type Details pop-up window:
    • Select Command: File Rename.
    • In the Path and Current File Name field, type C:\Start\File-to-be-renamed.txt
    • In the New File Name field, type File-to-be-moved.txt
    • Click the Save button.
  • In the User ID dropdown, select SMATRAINING\SMAUSER
  • Click the Save.
  • Click the Lock button in the upper right-hand corner.
  • Add some Documentation to the Job.
  • In the Frequency section, move Mon-Sun-O from the Inactive column and to the Active column.
  • Select the Frequency in the Active column and in Job Build Status dropdown, select On Hold.
  • Click the Save button.
  1. Click Back.
note

You may have noticed that you only need to specify the new file name and not the entire path when using this sub-type.

Add the Move Job to the Schedule

  1. Select Add Job in the side menu.
  2. On Master Job Definition screen:
  • In the Name field, enter File Move.
  • In the Job Type dropdown, select Windows.
  • In the Machine Selection dropdown, select the SMATraining machine for the Job to run on.
  • In the Job Sub-Type section, click the blue Edit button.
  • In the Job Sub-Type Details pop-up window:
    • Select Command: File Move.
    • In the Source field, type C:\Start\File-to-be-moved.txt
    • In the Destination field, type C:\Finish\File-to-be-deleted.txt
    • Click the Save button.
  • In the User ID dropdown, select SMATRAINING\SMAUSER
  • Click the Save
  • Click the Lock button in the upper right-hand corner.
  • Add some Documentation to the Job.
  • In the Frequency section, move Mon-Sun-O from the Inactive column and to the Active column.
  • Select the Frequency in the Active column and in Job Build Status dropdown, select On Hold.
  • Click the Save button.
  1. Click Back.

Add the Delete Job to the Schedule

  1. Select Add Job in the side menu.
  2. On Master Job Definition screen:
  • In the Name field, enter File Delete.
  • In the Job Type dropdown, select Windows.
  • In the Machine Selection dropdown, select the SMATraining machine for the Job to run on.
  • In the Job Sub-Type section, click the blue Edit button.
  • In the Job Sub-Type Details pop-up window:
    • Select Command: File Delete.
    • In the Source field, type C:\Finish\File-to-be-deleted.txt
    • Click the Save button.
  • In the User ID dropdown, select SMATRAINING\SMAUSER
  • Click the Save
  • Click the Lock button in the upper right-hand corner.
  • Add some Documentation to the Job.
  • In the Frequency section, move Mon-Sun-O from the Inactive column and to the Active column.
  • Select the Frequency in the Active column and in Job Build Status dropdown, select On Hold.
  • Click the Save button.
  1. Click Back.

Testing the Configuration

  1. In Operations, build Windows Sub-Types Exercise in a Released state for today only.
  2. In Processes, check that all Jobs are On Hold.
  3. Open the folder C:\Start using Windows Explorer and check that the file File-to-be-copied.txt is there.
  4. In Processes, release the File Copy Job.
  5. Go back to Windows Explorer and check that the File-to-be-renamed was created.
  6. In Processes, release the Job File Rename.
  7. Go back to Windows Explorer and check that the File-to-be-renamed is renamed to File-to-be-moved
  8. In Processes, release the Job File Move.
  9. Go back to Windows Explorer and check that the File-to-be-moved was moved to the C:\Finish folder and has the File-to-be-deleted name.
  10. In Processes, release the Job File Delete.
  11. Go back to Windows Explorer and check that the File-to-be-deleted was deleted.

Enterprise Manager

Details

Create a New File and a New Schedule

  1. Go to Windows Explorer and create the C:\Finish and C:\Start folders.
  2. If not running, open Notepad and create a new file.
  3. Type something and save the file as C:\Start\File-to-be-copied.txt.
  4. Close Notepad.
  5. Under the Administration topic, Double-Click on Schedule Master.
  6. Click the Add button on the Schedule Master toolbar.
  7. In the Name field, enter Windows Sub-Types Exercise.
  8. In the Documentation field, enter This is a training Schedule for Windows Sub-Type Jobs.
  9. Keep Monday through Friday selected for the Workdays per Week for the Schedule to run.
  10. In the Schedule Properties > Build frame, keep the Auto Build unchecked.
  11. Click the Save button on the Schedule Master toolbar.
  12. Close the Schedule Master tab.

Add Jobs to the New Schedule

  1. Under the Administration topic, Double-Click on Job Master.
  2. In the Schedule drop-down list, select Windows Sub-Types Exercise.
  3. Click the Add button on the Job Master toolbar.
  4. In the Name field, enter File Copy.
  5. In the Job Type drop-down list, select Windows.
  6. In the Job Sub-Type drop-down list select Command: File Copy.
  7. In the Primary Machine drop-down list, select the SMATraining machine for the Job to run on.
  8. In the User ID drop-down list, select SMATRAINING\SMAUSER
  9. In the Source field, type C:\Start\File-to-be-copied.txt
  10. In the Destination field, type C:\Start\File-to-be-renamed.txt
  11. Click the Save button on the Job Master toolbar.
  12. Click the Frequency tab.
  13. Within the Frequency list frame, click the Add button.
  14. On the Frequency Definition Wizard, keep Use existing Frequency selected and select Mon-Sun-O from the Frequency drop-down list. Then click Next.
  15. Click Finish.
  16. Under the Job Build Status frame, click the On Hold radio button.
  17. Click the Save button on the Job Master toolbar.
  18. Click the Documentation tab and add some documentation.
  19. Do not close the Job Master tab. Go to the next step.
  20. Click the Add button on the Job Master toolbar.
  21. In the Name field, enter File Rename.
  22. In the Job Type drop-down list, select Windows.
  23. In the Job Sub-Type drop-down list select Command: File Rename.
  24. In the Primary Machine drop-down list, select the SMATraining machine for the Job to run on.
  25. In the User ID drop-down list, select SMATRAINING\SMAUSER
  26. In the Path and Current File Name field, type C:\Start\File-to-be-renamed.txt
  27. In the New File Name field, type File-to-be-moved.txt
  • Note: You are renaming the file! So you do not specify the whole path!
  1. Click the Save button on the Job Master toolbar.
  2. Click the Frequency tab.
  3. Within the Frequency list frame, click the Add button.
  4. In the Frequency Definition Wizard, keep Use existing Frequency selected and select Mon-Sun-O from the Frequency drop-down list. Then click Next.
  5. Click Finish.
  6. Under the Job Build Status frame, click the On Hold radio button.
  7. Click the Save button on the Job Master toolbar.
  8. Click the Documentation tab and add some documentation.
  9. Click the Add button on the Job Master toolbar.
  10. In the Name field, enter File Move.
  11. In the Job Type drop-down list, select Windows.
  12. In the Job Sub-Type drop-down list select Command: File Move.
  13. In the Primary Machine drop-down list, select the SMATraining machine for the Job to run on.
  14. In the User ID drop-down list, select SMATRAINING\SMAUSER
  15. In the Source field, type C:\Start\File-to-be-moved.txt
  16. In the Destination field, type C:\Finish\File-to-be-deleted.txt
  17. Click the Save button on the Job Master toolbar.
  18. Click the Frequency tab.
  19. Within the Frequency list frame, click the Add button.
  20. On the Frequency Definition Wizard, keep Use existing Frequency selected and select Mon-Sun-O from the Frequency drop-down list. Then click Next.
  21. Click Finish.
  22. Under the Job Build Status frame, click the On Hold radio button.
  23. Click the Save button on the Job Master toolbar.
  24. Click the Documentation tab and add some documentation.
  25. Click the Add button on the Job Master toolbar.
  26. In the Name field, enter File Delete.
  27. In the Job Type drop-down list, select Windows.
  28. In the Job Sub-Type drop-down list select Command: File Delete.
  29. In the Primary Machine drop-down list, select the SMATraining machine for the Job to run on.
  30. In the User ID drop-down list, select SMATRAINING\SMAUSER
  31. In the File To Delete field, type C:\Finish\File-to-be-deleted.txt
  32. Click the Save button on the Job Master toolbar.
  33. Click the Frequency tab.
  34. Within the Frequency list frame, click the Add button.
  35. On the Frequency Definition Wizard, keep Use existing Frequency selected and select Mon-Sun-O from the Frequency drop-down list. Then click Next.
  36. Click Finish.
  37. Under the Job Build Status frame, click the On Hold radio button.
  38. Click the Save button on the Job Master toolbar.
  39. Click the Documentation tab and add some documentation.
  40. Close the Job Master tab.
  41. Use Workflow Designer to create your Job Dependencies.
  42. Your Schedule should look like this:

Testing the Configuration

  1. Manually build the Windows Sub-Types Exercise in a released state.
  2. Check that all Jobs are On Hold.
  3. Open the folder C:\Start using Windows Explorer and check that the file File-to-be-copied.txt is there.
  4. Go back to Enterprise Manager and Release the File Copy Job.
  5. Go back to Windows Explorer and check that the File-to-be-renamed was created.
  6. Go back to Enterprise Manager and Release the Job File Rename.
  7. Go back to Windows Explorer and check that the File-to-be-renamed is renamed to File-to-be-moved
  8. Go back to Enterprise Manager and Release the Job File Move.
  9. Go back to Windows Explorer and check that the File-to-be-moved was moved to the C:\Finish folder and has the File-to-be-deleted name.
  10. Go back to Enterprise Manager and Release the Job File Delete.
  11. Go back to Windows Explorer and check that the File-to-be-deleted was deleted.